<T:ViewBase x:Class="WPFExcelReport.TQP02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/> 
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>  
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Background="{StaticResource QueryZoneBrush}">
            <WrapPanel> 
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Grid.Column="0" Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Width="24" >查询</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <me:TSQP02 Visibility="Collapsed" Grid.Column="1" KEY="{Binding QPLAN,ElementName=TV}"/>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        
                     </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" >类型</TextBlock>
                    <ex:TXT72 MaxLength="1" PRE=" " Grid.Column="1"  FontSize="18" Foreground="Red"   Text="{Binding ARTST}" Width="30"/>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=分类:}}"></TextBlock> 
                    <ex:TXT72 MaxLength="2" Grid.Column="1" CharacterCasing="Upper" Text="{Binding KRS}" Width="40" />
                    <ex:TXT72 MaxLength="4" Grid.Column="2" CharacterCasing="Upper" Text="{Binding LFD}" Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=说明:}}"></TextBlock>
                    <ex:TXT72 MaxLength="10" Grid.Column="1" CharacterCasing="Upper" Text="{Binding DES, Converter={StaticResource gb2312}}" Width="100" />
                </Grid>
            </WrapPanel>
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}">
            <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=QPPPNRKRS}" Header=" "  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPPLFDNR}" Header="{Binding Source={Localization:Translate Word=质检计划}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPSPEZIF, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPARTST}" Header="{Binding Source={Localization:Translate Word=类型}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPPHASE}" Header="{Binding Source={Localization:Translate Word=阶段}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPAENB}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPAEND}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPNEUB}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPPNEUD}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Border>
    </Grid>
</T:ViewBase>
